<!DOCTYPE html>
<html>
<head>
    <title>Basic usage</title>
    <meta charset="utf-8">
    <link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../styles/kendo.default.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.default.min.css" rel="stylesheet">
    <script src="../../js/jquery.min.js"></script>
    <script src="../../js/kendo.all.min.js"></script>
    <script src="../content/shared/js/console.js"></script>
    <script>
        
    </script>
    
    
</head>
<body>
    
        <a class="offline-button" href="../index.html">Back</a>
    
            <script src="../content/web/globalization/cultures/kendo.culture.en-US.js"></script>
        <script src="../content/web/globalization/cultures/kendo.culture.en-GB.js"></script>
        <script src="../content/web/globalization/cultures/kendo.culture.de-DE.js"></script>
        <script src="../content/web/globalization/cultures/kendo.culture.fr-FR.js"></script>
        <script src="../content/web/globalization/cultures/kendo.culture.bg-BG.js"></script>

        <div id="example">
            <div id="product-view" class=" demo-section k-header">
                <div class="right">
                    <label for="culture">Choose culture:</label>
                    <input id="culture" value="en-US" />
                </div>
                <h2>Product promotion</h2>
                <ul id="fieldlist">
                    <li>
                    <label for="startDate">Discount start date:</label>
                    <input id="startDate" />
                    <input id="startTime" value="12:00 AM" />
                    </li>
                    <li>
                    <label for="endDate">Discount end date:</label>
                    <input id="endDate" />
                    <input id="endTime" value="12:00 AM" />
                    </li>
                    <li>
                    <label for="initial">Initial price:</label>
                    <input id="initial" value="10" min="1"/>
                    </li>
                    <li>
                    <label for="discount">Discount:</label>
                    <input id="discount" value="0.05" min="0" max="0.5" step="0.01"/>
                    </li>
                </ul>
            </div>

            <style scoped>
                #example h2 {
					padding: 5px 0;
                    font-weight: normal;
					border-bottom: 1px solid #aaa;
                }
                #product-view {
                    overflow: hidden;
                    width: 600px;
                    padding: 20px 20px 0 20px;
					margin: 30px auto;
                    background-position: 0 -255px;
                }

                .right
                {
                    float:right;
                }

                #fieldlist
                {
                    width: 100%;
                    float:left;
                    margin:0;
                    padding: 10px 0 30px 0;
                }

                #fieldlist li
                {
                    list-style:none;
                    padding:5px 0;
                }
				#fieldlist label {
					display: inline-block;
					width: 140px;
					text-align: right;
				}

            </style>

            <script>
                $(document).ready(function() {
                    function startDateChange() {
                        var date = startDate.value();

                        if (date) {
                            date = new Date(date);
                            date.setDate(date.getDate() + 1);
                            endDate.min(date);
                        }
                    }

                    function endDateChange() {
                        var date = endDate.value();

                        if (date) {
                            date = new Date(date);
                            date.setDate(date.getDate() - 1);
                            startDate.max(date);
                        }
                    }

                    function changeCulture() {
                        kendo.culture(this.value());

                        var datePickerOptions = {
                            format: kendo.culture().calendar.patterns.d
                        };

                        var timePickerOptions = {
                            format: kendo.culture().calendar.patterns.t
                        };

                        startDate.setOptions(datePickerOptions);
                        endDate.setOptions(datePickerOptions);

                        startTime.setOptions(timePickerOptions);
                        endTime.setOptions(timePickerOptions);

                        initial.value(initial.value());
                        discount.value(discount.value());
                    }

                    var startDate = new kendo.ui.DatePicker($("#startDate"), { change: startDateChange });
                    var endDate = new kendo.ui.DatePicker($("#endDate"), { change: endDateChange });

                    var startTime = new kendo.ui.TimePicker($("#startTime"));
                    var endTime = new kendo.ui.TimePicker($("#endTime"));

                    var initial = new kendo.ui.NumericTextBox($("#initial"), { format: "c" });
                    var discount = new kendo.ui.NumericTextBox($("#discount"), { format: "p" });

                    var today = new Date();

                    startDate.value(today);
                    endDate.min(today);

                    today = new Date(today);
                    today.setDate(today.getDate() + 1);

                    endDate.value(today);
                    startDate.max(today);

                    $("#culture").kendoDropDownList({
                        change: changeCulture,
                        dataTextField: "text",
                        dataValueField: "value",
                        dataSource: [{text: "bg-BG"},
                        {text: "de-DE"},
                        {text: "en-US"},
                        {text: "en-GB"}]
                    });
                });
            </script>
        </div>


    
    
</body>
</html>
